<include file="Public:header" />
<include file="Public:menu" />
<include file="Public:navibar" /><br />
<div>
    <switch name="select">
    <case value="edit">
        <h4>公告管理</h4>
        <form action="__URL__/edits" method="post" >
            <table border="1" width="100%">
                <tr>
                    <th>ID:</th>
                    <td>{{$news.news_id}}</td>
                </tr>
                <tr>
                    <th>公告标题:</th>
                    <td><input type="text" name="title" value="{{$news.title}}" /></td>
                </tr>
                <tr>
                    <th>公告内容</th>
                    <td>
                        <textarea style="width: 100%;height: 100%;min-height: 500px;padding: 0px;border: 0px;" name="content" >{{$news.content}}</textarea>
                    </td>
                </tr>
            </table>
            <input type="hidden" name="id" value="{{$news.news_id}}" />
            <button class="btn btn_silver fbold" type="submit" onClick="if (confirm('是否确认提交？'))this.form.submit();return false;"><span>提交</span></button><br />
        </form>
    </case>
    
    <case value="add">
        <h4>添加新公告</h4>
        <form action="__URL__/adds" method="post">
            <table border="1" width="100%">
                <tr>
                    <th style="width: 10%;">公告标题:</th>
                    <td><input type="text" name="title" value="{{$news.title}}" /></td>
                </tr>
                <tr>
                    <th style="width: 10%;">公告内容</th>
                    <td>
                       <textarea style="width: 100%;height: 100%;min-height: 500px;padding: 0px;border: 0px;" name="content"></textarea>
                    </td>
                </tr>
                <tr>
                    <th>是否发布</th>
                    <td><input type="checkbox" name="status" value="1"  />是</td>
                </tr>
            </table>
            <button class="btn btn_silver fbold" type="submit" onClick="if (confirm('是否确认提交？'))this.form.submit();return false;"><span>提交</span></button><br />
        </form>
    </case>
    
    <default />
    <h4>公告管理</h4>
    <hr>
    <a href="__URL__/add" class="btn btn_silver btn_small fbold" ><span>添加新公告</span></a>
    <form action="__URL__/delete" method="post">
        <table border="1" width="100%">
            <tr>
                <th><input type="checkbox" name="checkbox" value="" /></th>
                <th>ID</th>
                <th>公告标题</th>
                <th>是否发布</th>
                <th>发布时间</th>
                <th>操作</th>
            </tr>
            <volist name="news" id="vo">
            <tr>
                <td><input type="checkbox" name="id[]" value="{{$vo.news_id}}" /></td>
                <td>{{$vo.news_id}}</td>
                <td>{{$vo.title}}</td>
                <td><if condition="$vo.status eq '1'">是<else />否</if></td>
                <td>{{$vo.create_time|date="Y-n-j H:i:s",###}}</td>
                <td><input type="button"  value="编辑"  onClick="location.href='__URL__/edit/news_id/{{$vo.news_id}}';" >
                    <input type="button"  value="发布公告"  onClick="location.href='__URL__/publish/hidden_id/{{$vo.news_id}}';" >
                    <input type="button"  value="取消发布"  onClick="location.href='__URL__/publish/publish_id/{{$vo.news_id}}';" >
                </td>
            </tr>
            </volist>
            <tr>
                <td colspan="6"><input type="submit" value="删除" /></td>
            </tr>
        </table>
    </form>
    </switch>
</div>

<include file="Public:footer" />